const fs = require('fs-extra');
const path = require('path');

const filePath = path.join(__dirname, './output');
const fileNames = fs.readdirSync(filePath);


async function cleanDirectory(filePath) {
    try {
        // 清空目录
        await fs.emptyDir(filePath);
        console.log(`Directory '${filePath}' successfully cleaned.`);
    } catch (err) {
        console.error('Error cleaning directory:', err);
    }
}

// 遍历文件列表
fileNames.forEach((fileName) => {
    const filePath = path.join(__dirname, `./output/${fileName}`);
    cleanDirectory(filePath);
});

